<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateStatementTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateStatementLabel_date}" for="date" />
                    <h:inputText id="date" value="#{statementController.selected.date}" title="#{bundle.CreateStatementTitle_date}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_date}">
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.CreateStatementLabel_id}" for="id" />
                    <h:inputText id="id" value="#{statementController.selected.id}" title="#{bundle.CreateStatementTitle_id}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.CreateStatementLabel_type}" for="type" />
                    <h:inputText id="type" value="#{statementController.selected.type}" title="#{bundle.CreateStatementTitle_type}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.CreateStatementLabel_amount}" for="amount" />
                    <h:inputText id="amount" value="#{statementController.selected.amount}" title="#{bundle.CreateStatementTitle_amount}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_amount}"/>
                    <h:outputLabel value="#{bundle.CreateStatementLabel_balance}" for="balance" />
                    <h:inputText id="balance" value="#{statementController.selected.balance}" title="#{bundle.CreateStatementTitle_balance}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_balance}"/>
                    <h:outputLabel value="#{bundle.CreateStatementLabel_merchant}" for="merchant" />
                    <h:inputText id="merchant" value="#{statementController.selected.merchant}" title="#{bundle.CreateStatementTitle_merchant}" required="true" requiredMessage="#{bundle.CreateStatementRequiredMessage_merchant}"/>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{statementController.create}" value="#{bundle.CreateStatementSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{statementController.prepareList}" value="#{bundle.CreateStatementShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateStatementIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
